﻿<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:p="clr-namespace:BaMusaSoft.RPS.View.Properties"
        x:Class="BaMusaSoft.RPS.View.AddSignerWindow" x:Name="Window" Title="{Binding DisplayName}"
        Height="293" Width="480" FlowDirection="RightToLeft" WindowStartupLocation="CenterScreen" ResizeMode="NoResize"
         FontFamily="Simplified Arabic" WindowStyle="ToolWindow" FontSize="16" Loaded="WindowLoaded">

    <Grid x:Name="LayoutGrid">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid x:Name="SearchGrid" Grid.Row="0" Margin="10">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" Text="إسم المستأجر" />
            <TextBox Grid.Column="1" x:Name="txtCustomerName" Height="35"
               Text="{Binding Path=IdNumber, UpdateSourceTrigger=PropertyChanged}" TabIndex="0" />
            <Button Grid.Column="2" Content="{StaticResource FindImage}" Command="{Binding SearchCommand}" />
        </Grid>
        <Grid x:Name="ResultGrid" Grid.Row="1">
            <ListBox Margin="10,8,8,8" Grid.Column="1" Grid.Row="1" TabIndex="1" ItemsSource="{Binding Signers}"
               IsSynchronizedWithCurrentItem="True" SelectionChanged="ItemSelectionChanged">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <TextBlock Text="{Binding Name}" />
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>

        </Grid>
        <Grid x:Name="CommandsGrid" Grid.Row="2" Background="#FFF0F0F0" >
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Left">
                <Button Content="{StaticResource RefreshImage}" ToolTip="تحديث" Command="{Binding RefreshCommand}" Margin="10,0,0,0" />
            </StackPanel>
            <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
                <Button Content="{StaticResource OkImage}" TabIndex="3"  Click="OkButtonClick"
                IsDefault="True" />
                <Button Content="{StaticResource CancelImage}" HorizontalAlignment="Left" TabIndex="2" 
                        Click="CancelButtonClick" IsCancel="True" Margin="5,0,10,0" />

            </StackPanel>
        </Grid>
    </Grid>
</Window>